import threading
from queue import Queue
import time


def get_url(queue):
    while True:
        time.sleep(4)
        for i in range(1000):
            queue.put(f"http://www.io.com/file/article_{i}.html")


def get_detail(queue):
    while True:
        url = queue.get()
        print(f"get_detail {url} started")
        time.sleep(2)
        print(f"get_detail {url} end")

if __name__ == '__main__':
    queue = Queue(maxsize=1000)
    t = threading.Thread(target=get_url,args=(queue,))
    t.start()
    for i in range(10):
        t = threading.Thread(target=get_detail,args=(queue,))
        t.start()